//
//  ViewController.swift
//  2048
//
//  Created by iSolar on 2017/11/29.
//  Copyright © 2017年 com.ann.lmj. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        
        let gameButton = UIButton.init(frame: CGRect.init(x: (kWidth - 100)/2, y: kHeight / 2, width: 100, height: 35))
        view.addSubview(gameButton)
        gameButton.setTitle("开始游戏", for: .normal)
        gameButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        gameButton.setBackgroundImage(UIImage.createImage(with: UIColor.init(red: 0.8, green: 0.4, blue: 0.6, alpha: 1)), for: .normal)
        gameButton.addTarget(self, action: #selector(gameAction), for: .touchUpInside)
        
    }

    @objc func gameAction() {
        
        let vc = GameViewController()
        
        navigationController?.pushViewController(vc, animated: true)
        
    }
    

}

